<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    姓名：<input id="username" type="text">
    年龄：<input id="age" type="text">
    职业：<input id="profession" type="text">

    <button id="btn">跳转页面</button>

    <script>

        console.log(window.navigator);

        const usernameInp = document.querySelector('#username');
        const ageInp = document.querySelector('#age');
        const professionInp = document.querySelector('#profession');
        const btn = document.querySelector('#btn');

        btn.addEventListener('click', function () {
            const queryStr = `?username=${usernameInp.value}&age=${ageInp.value}&profession=${professionInp.value}`;
            location.href = '/Users/yuu/Documents/workspace/codes/chongqing06/demo小样/字符串处理/接受数据的页面.html' + queryStr;
        });

    </script>

</body>
</html>